<template>
    <div style="width:100%;background-color: rgba(237, 237, 237, 1);">
       <el-col style="width:100%;background-color: rgba(237, 237, 237, 1);">
        <el-row class="notice-row"><!--文字-系统通知-->
            系统通知
        </el-row>
        <el-row class="noticeRow"><!--公告-->
                <el-col class="notice-col">
                    <el-row class="notice-top"></el-row>
                    <el-row class="notice-main">
                        <el-col class="ye">
                            <el-row v-for="(item,index) in notices" :key="(item,index)" class="notice">
                                <span>通知{{ index +1 }}&nbsp;&nbsp;&nbsp;</span>
                                <span class="title" @click="dialogVisible=true">{{ item.title }}</span>
                                <el-dialog
                                                :visible.sync="dialogVisible"
                                                 width="50%">
                                                 <el-row style="font-size:17px;">读者须知：</el-row>
                                                 <el-row style="font-size:17px;margin-top:20px;">{{ item.content }}</el-row>
                                                 <span slot="footer" class="dialog-footer">
                                                 <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
                                                 </span>
                                </el-dialog>
                            </el-row>

                        </el-col>
                    </el-row>
                </el-col>
            </el-row>
            <el-row class="notice-row"><!--文字-读者咨询-->
                读者咨询
            </el-row>
            <el-row class="readerQ"><!--读者咨询-->
                <el-col style="height:100%;width:100%;">
                    <el-row class="firstRow">
                        管理员
                    </el-row>
                    <el-row class="seacondRow"><!--主消息框区域-->
                      <el-col style="width:100%;height:100%;">
                        <el-row><img  src="../../assets/img/common/zuo.jpg" class="zuo"></el-row>
                        <el-row><img v-if="msgVisible" src="../../assets/img/common/you.jpg" class="you"></el-row>
                      </el-col>
                    </el-row>
                    <el-row class="thirdRow">
                        <el-col style="height:100%;width:100%;">
                          <el-row class="moreRow"><img src="../../assets/img/common/more.jpg" class="moreImg"></el-row>
                            <el-row class="input">
                                <input class="input-main" v-model="msg">
                            </el-row>
                            <el-row class="btn-row">
                                <button class="pushMsg" @click="pushMsg">发送</button>
                            </el-row>
                        </el-col>
                    </el-row>

                </el-col>
            </el-row>
            <el-row style="background-color:white;"><!--bottom-->
                <bottom></bottom>
            </el-row>
       </el-col>
    </div>
</template>

<script>
import axios from "axios";
import bottom from "@/components/userCommon/bottom.vue"
import { Dialog } from "element-ui";
export default{
    name:"tell",
    components:{
    bottom,
    Dialog
},
mounted(){
  this.getNotices()
},
    data(){
        return{
            notices:[
            {title:'关于中南大学2024年放假通知',content:'111'},
            {title:'关于中南大学2024年放假通知',content:'111'},
            {title:'关于中南大学2024年放假通知',content:'111'},
            {title:'关于中南大学2024年放假通知',content:'111'},
            {title:'关于中南大学2024年放假通知',content:'111'},
            {title:'关于中南大学2024年放假通知',content:'111'},
            {title:'关于中南大学2024年放假通知',content:'111'},
          
        ],
        dialogVisible:false,
        msgVisible:false,
        msg:''
            
        }
    },
    methods:{
      pushMsg(){
        this.msgVisible=true;
        this.msg='';
      },
      getNotices(){
      axios({
        method:'get',
        url:'http://localhost:5000/reader/notice',
        params:{
    
        }
       
    }).then(r=>{//发送成功
      console.log(r.data.data)
        this. notices=r.data.data.noticeArray
    }).catch(r=>{
        console.log(r)
    })
    }

    }

}
</script>
<style scoped>
.notice-row{
    height:70px;
    width:150px;
    background-color: rgba(143, 175, 185, 0.7);
    margin-top:40px;
    font-size:30px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top-right-radius: 10px; /* 设置右上角圆角 */  
    border-bottom-right-radius: 10px; /* 设置左下角圆角 */  
}
.noticeRow{
    height: 380px;
    width:60%;
    background-image: url('../../assets/img/user/others/notice.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50px;
    margin-top:60px;
    margin-left:270px;
  }
  .notice-col{
    width:100%;
    height:100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .notice{
    display: flex;
    margin-left:10px;
    margin-top:15px;
    padding-bottom: 15px;
    border-bottom: 2px dashed rgba(79, 76, 76, 0.788); /* 只在底部设置虚线边框 */
  }
  .notice-top{
    height:15%;
    width:100%;
    background-color:rgba(143, 175, 185, 1);
    border-top-left-radius:50px;
    border-top-right-radius:50px;
  }
  .notice-main{
    background-color: rgba(255, 255, 255, 0.8);
    width:85%;
    height:67%;
    border-bottom-left-radius: 50px;
    border-bottom-right-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .readerQ{
    width:60%;
    height:470px;
    background-color: white;
    border-radius: 20px;
    margin-top:40px;
    margin-bottom: 50px;
    margin-left: 270px;
  }
  .title{
    cursor: pointer;
  }
  .title:hover{
    color:rgba(143, 175, 185, 1);
  }
  .firstRow{
    width:100%;
    height:10%;
    color:rgba(102, 101, 101, 1);
    font-size:18px;
    border-bottom: 1.5px solid rgba(229, 229, 229, 1);  
    padding-top:10px;
    padding-left:20px;

  }
  .seacondRow{
    width:100%;
    height:45%;
    border-bottom: 1.5px solid rgba(229, 229, 229, 1);  
    background-color: rgba(250,250,250);
  }
  .thirdRow{
    width:100%;
    height:40%;
  }
  .input{
    width:100%;
    height:60%;
  }
  .input-main{
    border-color: transparent;
    height:50%;
    width:80%;
    outline: none;
    font-size:18px;
  }
  .btn-row{
    width:100%;
    height:25%;
  }
  .pushMsg{
    height:40px;
    width:90px;
    background-color: rgba(125, 153, 191, 1);
    color:white;
    font-size:16px;
    letter-spacing: 2px;
    border-radius: 10px;
    border-color: transparent;
    margin-left:750px;
    cursor: pointer;
  }
  .zuo{
    height:90px;
  }
  .you{
    height:90px;
    margin-left:500px;
  }
  .moreRow{
    height:20%;
    width:100%;
  }
  .moreImg{
    height:100%;
  }
  .ye{
    height:100%;width:85%;overflow: auto;
  }
  .ye::-webkit-scrollbar{
     width: 0px; /* 设置滚动条的宽度 */
  }
</style>